JBoss Community Archive (Read Only)

WildFly 8

The HTTP management API

Work in progress...

Make sure you have added the user using add-user.sh.

This is simple operation that is equivalent of running :read-resource with CLI in root directory

$ curl --digest -L -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-attribute","name":"server-state","json.pretty":1}' -u admin
Enter host password for user 'admin':
HTTP/1.1 401 Unauthorized
Content-length: 0
Www-authenticate: Digest realm="ManagementRealm",nonce="7ed7d483aa1aa620845ab45d56995344"
Date: Wed, 25 Jan 2012 16:03:40 GMT

HTTP/1.1 200 OK
Transfer-encoding: chunked
Content-type: application/json
Date: Wed, 25 Jan 2012 10:05:52 GMT

{
    "outcome" : "success",
    "result" : "running"
}
Here's an example of an operation on a resource with a nested address and passed paramters

this is same as if you would run /host=master/server=server-01:read-attribute(name=server-state)

$ curl --digest -L -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-attribute","address":[{"host":"master"},{"server":"server-01"}],"name":"server-state","json.pretty":1}'
HTTP/1.1 200 OK
Transfer-encoding: chunked
Content-type: application/json
Date: Tue, 17 Apr 2012 04:02:24 GMT

{
    "outcome" : "success",
    "result" : "running"
}

Following example will get us information from http connection in web subsystem including run-time attributes

This is the same as running /subsystem=undertow/server=default-server/http-listener=default:read-resource(include-runtime=true) in CLI

curl --digest -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-resource", "include-runtime":"true" , "address":["subsystem","undertow","server","default-server", "http-listener","default"]}' -u user:pass

HTTP/1.1 200 OK
Transfer-encoding: chunked
Content-type: application/json
Date: Tue, 17 Jul 2012 15:48:39 GMT

{
    "outcome" : "success",
    "result" : {
        "bytesReceived" : "14727204",
        "bytesSent" : "2544228",
        "enable-lookups" : false,
        "enabled" : true,
        "errorCount" : "8",
        "executor" : null,
        "max-connections" : null,
        "max-post-size" : 2097152,
        "max-save-post-size" : 4096,
        "maxTime" : "1865",
        "name" : "http",
        "processingTime" : "12920",
        "protocol" : "HTTP/1.1",
        "proxy-name" : null,
        "proxy-port" : null,
        "redirect-port" : 8433,
        "requestCount" : "134",
        "scheme" : "http",
        "secure" : false,
        "socket-binding" : "http",
        "ssl" : null,
        "virtual-server" : null
    }
}
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:46:35 UTC, last content change 2015-03-13 10:56:23 UTC.